home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utilwb / mf4fxdsk.lha / fax_for_MTerm4.0 / source / fax_cat.c next >
C/C++ Source or Header  |  1996-05-03  |  3KB  |  92 lines

  1. /* Prototypes */
  2. #include <clib/locale_protos.h>
  3. #include <clib/dos_protos.h>
  4.  
  5. /* Pragmas */
  6. #ifdef AZTEC_C
  7. #include <pragmas/locale_lib.h>
  8. #endif /*   AZTEC_C            */
  9.  
  10. #if defined(__SASC)  ||  defined(_DCC)  ||  defined(__MAXON__)
  11. #include <pragma/locale_lib.h>     
  12. #endif    /*  __SASC  ||    _DCC  ||  __MAXON__    */
  13.  
  14. #ifdef __GNUC__
  15. #include <inline/locale.h>
  16. #endif    /*  __GNUC__    */
  17.  
  18. static LONG fax_Version = 0;
  19. static const STRPTR fax_BuiltInLanguage = (STRPTR) "english";
  20.  
  21. struct FC_Type
  22. {   LONG   ID;
  23.     char *Str;
  24. };
  25.  
  26. /* Definitions */
  27. const struct FC_Type _MSG_AppDescription = { 0, "Desk for Multifax 4.0 © by TKR" };
  28. const struct FC_Type _MSG_AppCopyright = { 1, "© by Jürgen Späth" };
  29. const struct FC_Type _MSG_Fax_Win = { 2, "MultiFax V 1.9 © 1996 J. Späth" };
  30. const struct FC_Type _MSG_MNlabel1Projekt = { 3, "Project" };
  31. const struct FC_Type _MSG_MNlabel1ber = { 4, "About" };
  32. const struct FC_Type _MSG_MNlabel1berChar = { 5, "a_" };
  33. const struct FC_Type _MSG_MNlabel1Beenden = { 6, "Quit" };
  34. const struct FC_Type _MSG_MNlabel1BeendenChar = { 7, "q_" };
  35. const struct FC_Type _MSG_BT_Printer = { 8, "_Printer-Server" };
  36. const struct FC_Type _MSG_BT_Spooler = { 9, "_Fax-Spooler" };
  37. const struct FC_Type _MSG_BT_Logbook = { 10, "_Logbook" };
  38. const struct FC_Type _MSG_BT_Config = { 11, "_Configuration" };
  39. const struct FC_Type _MSG_BT_Desktop = { 12, "De_sk" };
  40. const struct FC_Type _MSG_BT_Phone = { 13, "E_dit Phone" };
  41. const struct FC_Type _MSG_BT_View = { 14, "_View" };
  42. const struct FC_Type _MSG_BT_End = { 15, "_End" };
  43. const struct FC_Type _MSG_Info_Win = { 16, "Info" };
  44. const struct FC_Type _MSG_TX_ueber = { 17, "\nThe ultimative\n\nMulti-Fax-Desk\n\nShearware\n\n\0330 \033b© by Jürgen Späth\n\n\033nCompiled with MAXON\n\n at 27.April 1996\n\nMUI © by Stefan Stuntz\n\033b&\n\033n  MUI-Builder © by Eric Totel  \n" };
  45. const struct FC_Type _MSG_BT_OK = { 18, "_OK" };
  46. static struct Catalog *fax_Catalog = NULL;
  47.  
  48. void OpenAppCatalog(struct Locale *loc, STRPTR language)
  49. {
  50.     LONG tag, tagarg;
  51.     extern struct Library *LocaleBase;
  52.     extern void CloseAppCatalog(void);
  53.  
  54.     CloseAppCatalog(); /* Not needed if the programmer pairs OpenAppCatalog
  55.             and CloseAppCatalog right, but does no harm.  */
  56.  
  57.     if (LocaleBase != NULL  &&  fax_Catalog == NULL)
  58.     {
  59.     if (language == NULL)
  60.         tag = TAG_IGNORE;
  61.     else
  62.     {
  63.         tag = OC_Language;
  64.         tagarg = (LONG) language;
  65.     }
  66.     fax_Catalog = OpenCatalog(loc, (STRPTR) "fax.catalog",
  67.             OC_BuiltInLanguage, fax_BuiltInLanguage,
  68.             tag, tagarg,
  69.             OC_Version, fax_Version,
  70.             TAG_DONE);
  71.     }
  72. }
  73.  
  74. void CloseAppCatalog(void)
  75. {
  76.     if (LocaleBase)        
  77.         CloseCatalog(fax_Catalog);
  78.     fax_Catalog = NULL;
  79. }
  80.  
  81. char * GetFaxString(APTR fcstr)
  82. {
  83.     char *defaultstr;
  84.     LONG strnum;
  85.  
  86.     strnum = ((struct FC_Type *) fcstr)->ID;
  87.     defaultstr = ((struct FC_Type *) fcstr)->Str;
  88.  
  89.     return(fax_Catalog ? (char *)GetCatalogStr(fax_Catalog, strnum, defaultstr) :
  90.             defaultstr);
  91. }
  92.